package com.peking.donations.model;

import com.peking.donations.base.model.BaseModelAuditable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by wyz on 16/4/26.
 */

@Entity
@Table(name = "donation_saving")
public class DonationSaving extends BaseModelAuditable {

    public static final int SAVING_STATUS_SUCCESS = 1;// 交易成功

    public static final int SAVING_STATUS_IN_PROCESS = 0;// 交易进行中

    public static final int SAVING_TYPE_OWNER = 0;// 个人捐赠

    public static final int SAVING_TYPE_CALLORDER = 1;// 招募捐赠

    /**
     * 交易单号
     */
    @Column(name = "transaction_id")
    private String transactionId;

    /**
     * 微信平台交易id
     */
    @Column(name = "from_transaction_id")
    private String fromTransactionId;

    /**
     * 个人捐赠,招募捐赠
     */
    @Column(name = "type")
    private int type;

    /**
     * 交易金额(单位分)
     */
    @Column(name = "amount")
    private int amount;

    /**
     * 捐赠份额
     */
    @Column(name = "share")
    private int share;

    /**
     * 存单状态
     */
    @Column(name = "saving_status")
    private int savingStatus;

    /**
     * 用户
     */
    @Column(name = "user_id")
    private int userId;

    /**
     * 召集令(id)
     */
    @Column(name = "order_id")
    private Integer orderId;

    /**
     */
    @Column(name = "openId")
    private String openId;

    /**
     * 姓名
     */
    @Column(name = "real_name")
    private String realName;

    public String getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }

    public int getAmount() {
        return amount;
    }

    public void setAmount(int amount) {
        this.amount = amount;
    }

    public int getShare() {
        return share;
    }

    public void setShare(int share) {
        this.share = share;
    }

    public int getSavingStatus() {
        return savingStatus;
    }

    public void setSavingStatus(int savingStatus) {
        this.savingStatus = savingStatus;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    public String getFromTransactionId() {
        return fromTransactionId;
    }

    public void setFromTransactionId(String fromTransactionId) {
        this.fromTransactionId = fromTransactionId;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getRealName() {
        return realName;
    }

    public void setRealName(String realName) {
        this.realName = realName;
    }

    @Override
    public String toString() {
        return "DonationSaving{" + "transactionId='" + transactionId + '\'' + ", fromTransactionId='"
                + fromTransactionId + '\'' + ", type='" + type + '\'' + ", amount=" + amount + ", share=" + share
                + ", savingStatus=" + savingStatus + ", userId=" + userId + ", orderId=" + orderId + ", openId="
                + openId + '}';
    }
}
